﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Interop;
using System.Runtime.InteropServices;
using System.Windows;

namespace ContactCRUD.CustomControls
{
    
    public class ValidationTextBox : TextBox
    {
        
        public DependencyProperty ErrorMessageProperty = DependencyProperty.Register("ErrorMessage", typeof(string), typeof(ValidationTextBox),new PropertyMetadata(((object)("Failed"))));

        /// <summary>
        /// The error message to display when the validation failes 
        /// </summary>
        public string ErrorMessage
        {
            get
            { 
                return (string)GetValue(ErrorMessageProperty); 
            }
            set
            { 
                SetValue(ErrorMessageProperty, value); 
            }
        }
        public ValidationTextBox()
        {
            // the implict constructor
        }
        static ValidationTextBox()
        {
            // se the theme style
            // DefaultStyleKeyProperty.OverrideMetadata(typeof(ValidationTextBox), new FrameworkPropertyMetadata(typeof(ValidationTextBox)));
        }

    }
}
